import 'package:flutter_ncsjqz_getx/generated/json/base/json_convert_content.dart';
import 'package:flutter_ncsjqz_getx/model/shop_home_category_entity.dart';

ShopHomeCategoryEntity $ShopHomeCategoryEntityFromJson(Map<String, dynamic> json) {
	final ShopHomeCategoryEntity shopHomeCategoryEntity = ShopHomeCategoryEntity();
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		shopHomeCategoryEntity.msg = msg;
	}
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		shopHomeCategoryEntity.code = code;
	}
	final List<ShopHomeCategoryData>? data = jsonConvert.convertListNotNull<ShopHomeCategoryData>(json['data']);
	if (data != null) {
		shopHomeCategoryEntity.data = data;
	}
	return shopHomeCategoryEntity;
}

Map<String, dynamic> $ShopHomeCategoryEntityToJson(ShopHomeCategoryEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['msg'] = entity.msg;
	data['code'] = entity.code;
	data['data'] =  entity.data?.map((v) => v.toJson()).toList();
	return data;
}

ShopHomeCategoryData $ShopHomeCategoryDataFromJson(Map<String, dynamic> json) {
	final ShopHomeCategoryData shopHomeCategoryData = ShopHomeCategoryData();
	final String? categoryName = jsonConvert.convert<String>(json['categoryName']);
	if (categoryName != null) {
		shopHomeCategoryData.categoryName = categoryName;
	}
	final int? parentCategoryId = jsonConvert.convert<int>(json['parentCategoryId']);
	if (parentCategoryId != null) {
		shopHomeCategoryData.parentCategoryId = parentCategoryId;
	}
	final int? categoryId = jsonConvert.convert<int>(json['categoryId']);
	if (categoryId != null) {
		shopHomeCategoryData.categoryId = categoryId;
	}
	final String? pic = jsonConvert.convert<String>(json['pic']);
	if (pic != null) {
		shopHomeCategoryData.pic = pic;
	}
	final List<ShopHomeCategoryDataCommodityList>? commodityList = jsonConvert.convertListNotNull<ShopHomeCategoryDataCommodityList>(json['commodityList']);
	if (commodityList != null) {
		shopHomeCategoryData.commodityList = commodityList;
	}
	return shopHomeCategoryData;
}

Map<String, dynamic> $ShopHomeCategoryDataToJson(ShopHomeCategoryData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['categoryName'] = entity.categoryName;
	data['parentCategoryId'] = entity.parentCategoryId;
	data['categoryId'] = entity.categoryId;
	data['pic'] = entity.pic;
	data['commodityList'] =  entity.commodityList?.map((v) => v.toJson()).toList();
	return data;
}

ShopHomeCategoryDataCommodityList $ShopHomeCategoryDataCommodityListFromJson(Map<String, dynamic> json) {
	final ShopHomeCategoryDataCommodityList shopHomeCategoryDataCommodityList = ShopHomeCategoryDataCommodityList();
	final String? categoryName = jsonConvert.convert<String>(json['categoryName']);
	if (categoryName != null) {
		shopHomeCategoryDataCommodityList.categoryName = categoryName;
	}
	final int? parentCategoryId = jsonConvert.convert<int>(json['parentCategoryId']);
	if (parentCategoryId != null) {
		shopHomeCategoryDataCommodityList.parentCategoryId = parentCategoryId;
	}
	final int? categoryId = jsonConvert.convert<int>(json['categoryId']);
	if (categoryId != null) {
		shopHomeCategoryDataCommodityList.categoryId = categoryId;
	}
	final String? pic = jsonConvert.convert<String>(json['pic']);
	if (pic != null) {
		shopHomeCategoryDataCommodityList.pic = pic;
	}
	final dynamic? commodityList = jsonConvert.convert<dynamic>(json['commodityList']);
	if (commodityList != null) {
		shopHomeCategoryDataCommodityList.commodityList = commodityList;
	}
	return shopHomeCategoryDataCommodityList;
}

Map<String, dynamic> $ShopHomeCategoryDataCommodityListToJson(ShopHomeCategoryDataCommodityList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['categoryName'] = entity.categoryName;
	data['parentCategoryId'] = entity.parentCategoryId;
	data['categoryId'] = entity.categoryId;
	data['pic'] = entity.pic;
	data['commodityList'] = entity.commodityList;
	return data;
}